<script setup lang="ts">
import { ref } from 'vue';
import SonCom from './components/SonCom.vue';
const fname = ref('老明')
const fage = ref(20)
const fmale = ref('男')
const Soncall = (age: number) => {
  console.log('你是' + age + '岁的老登');
  console.log('我要你再老一岁');
  
}

const toOld = () => {
  fage.value++
  fname.value += '!'
}
</script>

<template>
  <div>
    <h2>我是父组件</h2>
    <SonCom :name="fname" :age="fage" :male="fmale" @change-age="Soncall"></SonCom>
    <SonCom></SonCom>
    <button @click="toOld">老一岁</button>
  </div>
</template>

<style scoped></style>
